// --------------------------------------------------------------------------------------------------------------------
// <copyright file="InstrumentStaticDataEquity.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Org.OpenTrader.Framework.Forge
{
    #region Usings

    using System;
    using System.ComponentModel;

    using Org.OpenTrader.Framework.Forge.Attributes;
    using Org.OpenTrader.Framework.Forge.DataModel;
    using Org.OpenTrader.Framework.Forge.Enums;
    using Org.OpenTrader.Framework.Forge.Interfaces;

    #endregion

    /// <summary>
    /// The instrument equity.
    /// </summary>
    [Serializable]
    [InstrumentFriendlyDisplay("Equity", "Simple Equity/Share")]
    public sealed class InstrumentStaticDataEquity : InstrumentStaticData, IInstrumentStaticDataEquity
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="InstrumentStaticDataEquity"/> class. 
        /// Initializes a new instance of the <see cref="InstrumentEquity"/> class.
        /// </summary>
        /// <param name="dictionaryID">
        /// The dictionary ID.
        /// </param>
        /// <param name="dbInstrumentEquity">
        /// The dbInstrumentEquity.
        /// </param>
        /// <param name="dbInstrument">
        /// The dbInstrument.
        /// </param>
        public InstrumentStaticDataEquity(Guid dictionaryID, DBInstrumentStaticDataEquity dbInstrumentEquity, DBInstrumentStaticData dbInstrument)
            : base(dictionaryID, dbInstrument)
        {
            this.Sector = EnumDecoder<ESector>.Parse(dbInstrumentEquity.Sector);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets FriendlyName.
        /// </summary>
        public override string FriendlyName
        {
            get
            {
                return base.FriendlyName + " (Equity)";
            }
        }

        /// <summary>
        /// Gets or sets Sector.
        /// </summary>
        [Category("Equity")]
        [Description("The Sector of the Equity")]
        public ESector Sector { get; set; }

        /// <summary>
        /// Gets Type.
        /// </summary>
        public override string Type
        {
            get
            {
                return "Equity";
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// The string representation.
        /// </summary>
        /// <returns>
        /// Returns "Equity"
        /// </returns>
        public override string ToString()
        {
            return base.ToString() + " (Equity)";
        }

        #endregion
    }
}